/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JFrameCredits.java
 *
 * Created on 01-jun-2010, 10:16:16
 */

package GUI;

import javax.jws.soap.SOAPBinding.Style;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyleContext;
import libraries.MultimediaLibrary;

/**
 *
 * @author aeguzkiza
 */
public class JFrameCredits extends javax.swing.JFrame {

    MultimediaLibrary Lib = MultimediaLibrary.getInstance();

    // DEFINICIÓN DE LOS IMAGEICON
    ImageIcon upna = Lib.getImageIcon(1);
    ImageIcon gn = Lib.getImageIcon(2);
    ImageIcon iconV = Lib.getImageIcon(3);



    /** Creates new form JFrameCredits */
    public JFrameCredits() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        AuthorsLabel = new javax.swing.JLabel();
        CollaboratorsLabel = new javax.swing.JLabel();
        CollaboratorsPanel = new javax.swing.JPanel();
        UPNALabel = new javax.swing.JLabel();
        GNLabel = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jEditorPane1 = creaJTextPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("CREDITOS: Autores y colaboradores en el proyecto");
        setResizable(false);

        AuthorsLabel.setFont(new java.awt.Font("Tahoma", 1, 12));
        AuthorsLabel.setText("AUTORES:");

        CollaboratorsLabel.setFont(new java.awt.Font("Tahoma", 1, 12));
        CollaboratorsLabel.setText("COLABORADORES:");

        CollaboratorsPanel.setBackground(new java.awt.Color(255, 255, 255));
        CollaboratorsPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        UPNALabel.setForeground(new java.awt.Color(255, 255, 255));
        UPNALabel.setIcon(upna);

        GNLabel.setIcon(gn);

        javax.swing.GroupLayout CollaboratorsPanelLayout = new javax.swing.GroupLayout(CollaboratorsPanel);
        CollaboratorsPanel.setLayout(CollaboratorsPanelLayout);
        CollaboratorsPanelLayout.setHorizontalGroup(
            CollaboratorsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, CollaboratorsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(UPNALabel, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
                .addComponent(GNLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        CollaboratorsPanelLayout.setVerticalGroup(
            CollaboratorsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CollaboratorsPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(CollaboratorsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, CollaboratorsPanelLayout.createSequentialGroup()
                        .addComponent(GNLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(8, 8, 8))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, CollaboratorsPanelLayout.createSequentialGroup()
                        .addComponent(UPNALabel, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );

        jEditorPane1.setEditable(false);
        jScrollPane1.setViewportView(jEditorPane1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(AuthorsLabel, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(CollaboratorsPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(CollaboratorsLabel, javax.swing.GroupLayout.Alignment.LEADING)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(AuthorsLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(CollaboratorsLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(CollaboratorsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JFrameCredits().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel AuthorsLabel;
    private javax.swing.JLabel CollaboratorsLabel;
    private javax.swing.JPanel CollaboratorsPanel;
    private javax.swing.JLabel GNLabel;
    private javax.swing.JLabel UPNALabel;
    private javax.swing.JEditorPane jEditorPane1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables

    private JTextPane creaJTextPane() { // CREA UN JTEXTPANE CONCRETO CON DIFERENTES ESTILOS EN EL TEXTO
        JTextPane jTextPane = new JTextPane();
        String[] initString =
        {  " \n\n\t\t"     // regular
        };

        String[] initStyles =
        { "negrita", "regular", "negrita", "regular", "negrita",
          "regular", "negrita", "regular"
        };
        estilosJTextPane(jTextPane);
        Document doc = jTextPane.getDocument();

        try {
          for (int i=0; i < initString.length; i++) {
            doc.insertString(doc.getLength(), initString[i], jTextPane.getStyle(initStyles[i]));
          }
        } catch (BadLocationException ble) {
          System.err.println("Couldn't insert initial text.");
        }
        return jTextPane;
    }
    protected void estilosJTextPane(JTextPane textPane) {   // DEFINE DIFERENTES ESTILOS DE TEXTO
        //Initialize some styles.
        javax.swing.text.Style defecto = StyleContext.getDefaultStyleContext().
        getStyle(StyleContext.DEFAULT_STYLE);

        javax.swing.text.Style regular = textPane.addStyle("regular", defecto);
        StyleConstants.setFontFamily(defecto, "Bitstream Vera Serif");

        javax.swing.text.Style s = textPane.addStyle("negrita", regular);
        StyleConstants.setBold(s, true);
    }

}
